<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <title>下载APP</title>
  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
  <meta name="keywords" content="" />
  <meta name="description" content="" />
  <meta name="apple-mobile-web-app-capable" content="no" />
  <meta name="format-detection" content="telephone=no">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/base.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/index.css">
</head>

<body class="ovh">
  <div class="guide_content">
    <div class="guide">
      <div class="guide_tips"></div>
      <div class="tc guide_footer">
        <a class="dib vm btn_home" href="${pageContext.request.contextPath}/friend/toRS"></a>
        <a class="dib vm btn_download" href="http://file.dmeihui.com/Android/dmh.apk"></a>
      </div>
    </div>
  </div>
  <script>
    var u = navigator.userAgent;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
    window.addEventListener('DOMContentLoaded', function () {
    
      var download = document.querySelector('.btn_download')
      var ele = document.querySelector('.guide')
      var wh = ele.offsetWidth
      var ht = ele.offsetHeight
      var scale = (wh / ht).toPrecision(3)
      if (wh > ht) {
        ele.style.height = wh * scale + 'px';
      } else {
        scale = (ht / wh).toPrecision(3)
      }
      
      if (isAndroid) {
        download.href = 'http://file.dmeihui.com/Android/dmh.apk'
      }
      if (isiOS) {
        download.href = 'https://itunes.apple.com/us/app/de-mei-hui/id1172771690?l=zh&ls=1&mt=8'
      }else{
    	 download.href = 'http://file.dmeihui.com/Android/dmh.apk'
      }
      window.addEventListener('resize', function () {
        wh = ele.offsetWidth
        ht = ele.offsetHeight
        if (wh > ht) {
          ele.style.height = wh * scale + 'px';
        } else {
          ele.removeAttribute('style')
        }
      }, false)
    }, false)

  </script>
</body>

</html>
